home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Mac Format 1994 October
/
Macformat17.cdr
/
Shareware City
/
Developers
/
shutdown-fx-20-c
/
Shutdown proc ƒ
/
sfx shutdown proc.c
next >
Wrap
C/C++ Source or Header
|
1994-07-11
|
1KB
|
76 lines
struct QDGlobals
{
char privates[76];
long randSeed;
BitMap screenBits;
Cursor arrow;
Pattern dkGray;
Pattern ltGray;
Pattern gray;
Pattern black;
Pattern white;
GrafPtr thePort;
long end;
};
typedef struct QDGlobals QDGlobals;
typedef pascal short (*FadeProcPtr)(Rect boundsRect, Pattern *thePattern);
pascal void main(void);
pascal void DoTheDangFade(FadeProcPtr theFade);
pascal void main(void)
{
FadeProcPtr theFade;
short doFade;
asm
{
bra.s @3 /* branch past raw data */
@1 dc.l 0 /* will be set to address of fade */
@2 dc.w 0 /* will be set to 1 or 0 (do fade or not) */
@3 move.l @1, theFade /* move address of fade into local var */
move.w @2, doFade /* move do fade flag into local var */
}
if (doFade)
DoTheDangFade(theFade);
}
pascal void DoTheDangFade(FadeProcPtr theFade)
{
short oldMenuBarHeight;
long oldA5;
QDGlobals qd; /* our QD globals. */
GrafPort gp; /* our grafport. */
GrafPtr savePort;
THz saveZone;
GetPort(&savePort);
oldMenuBarHeight=MBarHeight;
MBarHeight=0;
DrawMenuBar();
/* get a value for A5, a structure that mirrors qd globals. */
oldA5 = SetA5((long)&qd.end);
InitGraf(&qd.thePort);
OpenPort(&gp);
HideCursor();
saveZone=GetZone();
SetZone(SysZone);
theFade(gp.portRect, &qd.black);
SetZone(saveZone);
MBarHeight=oldMenuBarHeight;
ShowCursor();
ObscureCursor();
ClosePort(&gp);
SetA5(oldA5);
SetPort(savePort);
}